let selectIndicatorType = {
    type: 'select',
    options: [
        { label: '数量指标', value: 'male' },
        { label: '质量指标', value: 'female' },
        { label: '时效指标', value: 's' },
        { label: '成本指标', value: 'nm' }
    ]
}
let selectOperatorType = {
    type: 'select',
    options: [
        { label: '>', value: '>' },
        { label: '≥', value: '>=' },
        { label: '<', value: '<' },
        { label: '≤', value: '<=' },
        { label: '=', value: '=' },
        { label: '文字描述', value: '文字描述' },
    ]
}
let inputType = { type: 'input' }
//let FstScndPerfIndicator = await this.getFstScndPerfIndicator(useOldKpi);
let FstScndPerfIndicator=[
    {
        "IND_ID": "AF2AD8E6-A8BF-00E0-E053-0A20000DCEDF",
        "LEVEL_NO": 1,
        "PARENT_ID": "0",
        "IND_CODE": "1",
        "IND_NAME": "产出指标",
        "childList": [
            {
                "IND_ID": "AF2AD8E6-A8C0-00E0-E053-0A20000DCEDF",
                "LEVEL_NO": 2,
                "PARENT_ID": "AF2AD8E6-A8BF-00E0-E053-0A20000DCEDF",
                "IND_CODE": "11",
                "IND_NAME": "数量指标"
            },
            {
                "IND_ID": "AF2AD8E6-A8C1-00E0-E053-0A20000DCEDF",
                "LEVEL_NO": 2,
                "PARENT_ID": "AF2AD8E6-A8BF-00E0-E053-0A20000DCEDF",
                "IND_CODE": "12",
                "IND_NAME": "质量指标"
            },
            {
                "IND_ID": "AF2AD8E6-A8C2-00E0-E053-0A20000DCEDF",
                "LEVEL_NO": 2,
                "PARENT_ID": "AF2AD8E6-A8BF-00E0-E053-0A20000DCEDF",
                "IND_CODE": "13",
                "IND_NAME": "时效指标"
            },
            {
                "IND_ID": "AF2AD8E6-A8C3-00E0-E053-0A20000DCEDF",
                "LEVEL_NO": 2,
                "PARENT_ID": "AF2AD8E6-A8BF-00E0-E053-0A20000DCEDF",
                "IND_CODE": "14",
                "IND_NAME": "成本指标"
            }
        ]
    },
    {
        "IND_ID": "AF2AD8E6-A8C4-00E0-E053-0A20000DCEDF",
        "LEVEL_NO": 1,
        "PARENT_ID": "0",
        "IND_CODE": "2",
        "IND_NAME": "效益指标",
        "childList": [
            {
                "IND_ID": "AF2AD8E6-A8C5-00E0-E053-0A20000DCEDF",
                "LEVEL_NO": 2,
                "PARENT_ID": "AF2AD8E6-A8C4-00E0-E053-0A20000DCEDF",
                "IND_CODE": "21",
                "IND_NAME": "经济效益指标"
            },
            {
                "IND_ID": "AF2AD8E6-A8C6-00E0-E053-0A20000DCEDF",
                "LEVEL_NO": 2,
                "PARENT_ID": "AF2AD8E6-A8C4-00E0-E053-0A20000DCEDF",
                "IND_CODE": "22",
                "IND_NAME": "社会效益指标"
            },
            {
                "IND_ID": "AF2AD8E6-A8C7-00E0-E053-0A20000DCEDF",
                "LEVEL_NO": 2,
                "PARENT_ID": "AF2AD8E6-A8C4-00E0-E053-0A20000DCEDF",
                "IND_CODE": "23",
                "IND_NAME": "生态效益指标"
            },
            {
                "IND_ID": "AF2AD8E6-A8C8-00E0-E053-0A20000DCEDF",
                "LEVEL_NO": 2,
                "PARENT_ID": "AF2AD8E6-A8C4-00E0-E053-0A20000DCEDF",
                "IND_CODE": "24",
                "IND_NAME": "可持续影响指标"
            }
        ]
    },
    {
        "IND_ID": "AF2AD8E6-A8C9-00E0-E053-0A20000DCEDF",
        "LEVEL_NO": 1,
        "PARENT_ID": "0",
        "IND_CODE": "3",
        "IND_NAME": "满意度指标",
        "childList": [
            {
                "IND_ID": "AF2AD8E6-A8CA-00E0-E053-0A20000DCEDF",
                "LEVEL_NO": 2,
                "PARENT_ID": "AF2AD8E6-A8C9-00E0-E053-0A20000DCEDF",
                "IND_CODE": "31",
                "IND_NAME": "服务对象满意度指标"
            }
        ]
    }
]
let customInputRow = {
    '1': {
        def: selectIndicatorType,
        value: '',
    },
    '2': {
        def: inputType,
        value: '',
    },
    '3': {
        def: inputType,
        value: '',
    },
    '4': {
        def: selectOperatorType
    },
    '5': {
        def: inputType,
        value: '',
    },
    '6': {
        def: inputType,
        value: '',
    },
    '7': {
        def: inputType,
        value: '',
    },
    '8': {
        def: inputType,
        value: '',
    },
    getCopy(childList) {
        let secondIndicatorType= {
            type: 'select',
            options: childList.map(item => {
                    return {
                        label: item.IND_NAME,
                        value: item.IND_ID
                    }
                }
            )
        }
        let copy = JSON.parse(JSON.stringify(this));
        copy['1'].def = secondIndicatorType
        return copy;
    }
}
let headers = {
    "0": {
        "0": {
            def: { type: 'text' },
            value: '年度绩效目标',
            colspan: 9,
        },
    }
}
let cells = {
    "0": {
        "0": {
            def: { type: 'text' },
            value: '资金用途',
        },
        "1": {
            def: { type: 'input' },
            value: '1111111',
            colspan: 8,
            style:{
                "text-align":"left"
            }
        }
    },
    "1": {
        "0": {
            def: { type: 'text' },
            value: '资金支出计划',
            rowspan: 2,
        },
        "1": {
            def: { type: 'text' },
            value: '3月底',
            colspan: 2,
        },
        "3": {
            def: { type: 'text' },
            value: '6月底',
        },
        "4": {
            def: { type: 'text' },
            value: '10月底',
            colspan: 3,
        },
        "7": {
            def: { type: 'text' },
            value: '12月底',
            colspan: 2,
        },
    },
    "2": {
        "1": {
            def: { type: 'input' },
            value: '',
            colspan: 2,
        },
        "3": {
            def: { type: 'input' },
            value: '',
        },
        "4": {
            def: { type: 'input' },
            value: '',
            colspan: 3,
        },
        "7": {
            def: { type: 'input' },
            value: '',
            colspan: 2,
        },
    },
    "3": {
        '0': {
            def: { type: 'text' },
            value: '绩效目标',
            rowspan: 3,
        },
        '1': {
            def: { type: 'text' },
            value: '目标1',
            style:{
                width: '100px'
            }
        },
        '2': {
            def: { type: 'input' },
            value: '',
            colspan: 7,
        }
    },
    "4": {
        '1': {
            def: { type: 'text' },
            value: '目标2',
        },
        '2': {
            def: { type: 'input' },
            value: '',
            colspan: 7,
        }
    },
    "5": {
        '1': {
            def: { type: 'text' },
            value: '目标3',
        },
        '2': {
            def: { type: 'input' },
            value: '',
            colspan: 7,
        }
    },
    "6": {
        '0': {
            def: { type: 'text' },
            value: '一级指标',
            rowspan: 2,
        },
        '1': {
            def: { type: 'text' },
            value: '二级指标',
            rowspan: 2,
        },
        '2': {
            def: { type: 'text' },
            value: '三级指标',
            rowspan: 2,
            style:{
                width: '100px'
            }
        },
        '3': {
            def: { type: 'text' },
            value: '绩效指标描述(指标内容)',
            rowspan: 2,
            style:{width: '180px'}
        },
        '4': {
            def: { type: 'text' },
            value: '指标值',
            colspan: 3
        },
        '7': {
            def: { type: 'text' },
            value: '指标确定依据',
            rowspan: 2,
            style:{width: '120px'}
        },
        '8': {
            def: { type: 'text' },
            value: '评(扣)分标准',
            rowspan: 2,
            style:{width: '120px'}
        },
        "9": {
            type: 'select',
            value: '',
            options: [
                { label: '男', value: 'male' }
                , { label: '女', value: 'female' }
            ]
        },
    },
    "7": {
        '4': {
            def: { type: 'text' },
            value: '符号',
        },
        '5': {
            def: { type: 'text' },
            value: '值',
            style:{
                width: '50px'
            }
        },
        '6': {
            def: { type: 'text' },
            value: '单位(文字描述)',
            style:{width: '120px'}
        },
    },
    "8": {
        '0': {
            def: { type: 'text' },
            value: FstScndPerfIndicator[0].IND_NAME,
            rowspan: 3,
            data: FstScndPerfIndicator[0]
        },
        ...customInputRow.getCopy(FstScndPerfIndicator[0].childList)
    },
    '9': {
        ...customInputRow.getCopy(FstScndPerfIndicator[0].childList)
    },
    "10": {
        ...customInputRow.getCopy(FstScndPerfIndicator[0].childList)
    },
    "11": {
        '0': {
            def: { type: 'text' },
            value: FstScndPerfIndicator[1].IND_NAME,
            rowspan: 3,
            data: FstScndPerfIndicator[1]
        },
        ...customInputRow.getCopy(FstScndPerfIndicator[1].childList)
    },
    '12': {
        ...customInputRow.getCopy(FstScndPerfIndicator[1].childList)
    },
    "13": {
        ...customInputRow.getCopy(FstScndPerfIndicator[1].childList)
    },
    "14": {
        '0': {
            def: { type: 'text' },
            value: FstScndPerfIndicator[2].IND_NAME,
            rowspan: 3,
            data: FstScndPerfIndicator[2]
        },
        ...customInputRow.getCopy(FstScndPerfIndicator[2].childList)
    },
    '15': {
        ...customInputRow.getCopy(FstScndPerfIndicator[2].childList)
    },
    "16": {
        ...customInputRow.getCopy(FstScndPerfIndicator[2].childList)
    },
}
export {selectIndicatorType,selectOperatorType,inputType,customInputRow,headers,cells}